package cn.iocoder.yudao.module.erp.controller.app.purchasemanage;


import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.erp.controller.app.purchasemanage.vo.PurchaseManageRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.purchasemanage.PurchaseManageDO;
import cn.iocoder.yudao.module.erp.service.purchasemanage.PurchaseManageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "app - 采购管理主")
@RestController
@RequestMapping("/erp/app/purchase-manage")
@Validated
public class AppPurchaseManageController {

    @Resource
    private PurchaseManageService purchaseManageService;

    @GetMapping("/get")
    @Operation(summary = "获得采购管理主")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    public CommonResult<PurchaseManageRespVO> getPurchaseManage(@RequestParam("id") Long id) {
        PurchaseManageDO purchaseManage = purchaseManageService.getPurchaseManage(id);
        return success(BeanUtils.toBean(purchaseManage, PurchaseManageRespVO.class));
    }
}